package com.zx.fm.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zx.common.annotation.Excel;
import com.zx.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * -- 高贵的马儿驱逐体内的一切外力 --
 *
 * @author kaajee
 * @date 2025/9/5
 * @desc
 */
@Setter
@Getter
public class Receipt extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 收款ID */
    private Long id;

    /** 收款编号 */
    @Excel(name = "收款编号")
    private String receiptNo;

    /** 经办人ID */
    @Excel(name = "经办人ID")
    private Long userId;

    /** 关联项目ID */
    @Excel(name = "关联项目ID")
    private Long projectId;

    /** 已收款金额 */
    @Excel(name = "已收款金额")
    private BigDecimal amountReceived;

    /** 已开票金额 */
    @Excel(name = "已开票金额")
    private BigDecimal amountIssued;

    /** 收款方式(1.现金,2转账) */
    @Excel(name = "收款方式")
    private String paymentMethod;

    /** 甲方单位 */
    @Excel(name = "甲方单位")
    private String payer;

    /** 收款原因 */
    @Excel(name = "收款原因")
    private String reason;

    /** 收款时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "收款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date receiptTime;

    /** 状态：1-待确认，2-已完成 */
    @Excel(name = "状态")
    private String status;

    /** 收款银行 */
    @Excel(name = "收款银行")
    private String receiveBank;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long receiveAccount;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("receiptNo", getReceiptNo())
                .append("userId", getUserId())
                .append("projectId", getProjectId())
                .append("amountReceived", getAmountReceived())
                .append("amountIssued", getAmountIssued())
                .append("paymentMethod", getPaymentMethod())
                .append("payer", getPayer())
                .append("reason", getReason())
                .append("receiptTime", getReceiptTime())
                .append("status", getStatus())
                .append("receiveBank", getReceiveBank())
                .append("receiveAccount", getReceiveAccount())
                .toString();
    }
}